]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
LayoutManager: untrack actors that are destroyed
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 8 Feb 2014 20:44:58 +0000 (21:44 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 9 Feb 2014 18:30:02 +0000 (19:30 +0100)
If an actor is destroyed, calling get_transformed_size()/position()
can return bogus values and trigger JS exceptions.
This can happen if a tracked actor comes from an extension
(such as classic mode's window-list) and that extension is
deactivated.

https://bugzilla.gnome.org/show_bug.cgi?id=723661

js/ui/layout.js

index 0609ff2e070cbfb414cf97d2fe827a45b454e21c..6f7bcebc529da99a1362c428314a001cde9fe3aa 100644 (file)
@@ -834,6 +834,8 @@ const LayoutManager = new Lang.Class({
                                             Lang.bind(this, this._queueUpdateRegions));
         actorData.allocationId = actor.connect('notify::allocation',
                                                Lang.bind(this, this._queueUpdateRegions));
+        actorData.destroyId = actor.connect('destroy',
+                                            Lang.bind(this, this._untrackActor));
         // Note that destroying actor will unset its parent, so we don't
         // need to connect to 'destroy' too.
 
@@ -852,6 +854,7 @@ const LayoutManager = new Lang.Class({
         actor.disconnect(actorData.visibleId);
         actor.disconnect(actorData.allocationId);
         actor.disconnect(actorData.parentSetId);
+        actor.disconnect(actorData.destroyId);
 
         this._queueUpdateRegions();
     },